<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>热门单品</title>
    <link rel="stylesheet" href="./css/reset.css">
    <style>
        body{
            background-color: #f5f5f5;
        }
        #app{
            width: 340px;
            height: 360px;
            padding: 0 10px;
            border-radius: 5px;
            background-color: #fff;
            margin: 100px auto;
        }
        .title{
            height: 40px;           
            line-height: 40px;
            font-weight: 700;
            /* background-color: red; */
        }
        /* .list{} */
        .item{
            height: 100px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            /* background-color: yellow; */
        }
        .left{
            width: 80px;
            height: 80px;
            background-color: red;
            position: relative;
            border-radius: 5px;
        }
        img{
            width: 100%;
            height: 100%;
            position: absolute;
        }
        .price{
            width: 100%;
            height: 20px;
            background-color: rgba(207, 185, 185, 0.355);
            color: white;
            font-size: 12px;
            padding: 0 5px;
            line-height: 20px;
            position: absolute;
            bottom: 0;
        }
        .middle{
            flex: 1;
            line-height: 20px;
            margin-left: 20px;
        }
        .name{
            font-size: 14px;
            font-weight: 700;
        }
        .discount{
            font-size: 12px;
            color: red;
        }
        .bonus{
            font-size: 14px;
            color: red;
        }
        p{
            font-size: 12px;
            color: gainsboro;
            /* margin-top: 8px; */
        }
        button{
            width: 80px;
            height: 30px;
            border-radius: 20px;
            color: white;
            background-color: red;
            letter-spacing: 2px;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="title">
            热门单品
        </div>
        <div class="list">
            <div class="item" v-for="(item,index) in tasklist" v-bind:key="index">
                <div class="left">
                    <img v-bind:src="item.pic" alt="">
                    <div class="price">价值 ￥{{item.price}}</div>
                </div>
                <div class="middle">
                    <div class="name">{{item.name}}</div>
                    <div class="discount">{{item.discount}}</div>
                    <div class="jianglijin">
                        <span class="iconfont ">#</span>
                        <span class="bonus">{{item.bonus}}</span>
                    </div>
                    <p>适用门店&gt;</p>
                </div>
                <div class="right">
                    <button>{{item.status == true ? '立即兑' : '已兑换'}}</button>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script src="./js/vue-2.5.21.js"></script>
<script>
    let v=new Vue({
        el:'#app',
        data:{
            tasklist:[
                {id:1,pic:'./img/pic1.png',price:9.9,name:'脐橙3斤 快递到家',discount:'兑换后入手价8.9元',bonus:'10',status:true},
                {id:2,pic:'./img/pic2.png',price:12.9,name:'粑粑柑2斤 快递到家',discount:'兑换后入手价9.9元',bonus:'30',status:true},
                {id:3,pic:'./img/pic3.png',price:12.9,name:'水果捞350g',discount:'兑换后入手价6.9元',bonus:'60',status:false},
            ]
        }
    })
</script>